package controllers

import (
	"beego/mongo"
	"github.com/astaxie/beego"
)

type GetPoemController struct {
	beego.Controller
}

var count = 0

func (c *GetPoemController) Get() {
	mongo.MgoCli()
	//mongo.SetManyPoems()

	count++
	if count > mongo.MongoCountPoem() {
		count = 1
	}
	c.Data["json"] = mongo.GetPoem(count)[0]
	c.ServeJSON()
}
